using System;
using System.Collections.Generic;
using System.Data;

namespace SLIITPro.Data.Entity
{
    public class BusinessItem
    {

        private int _bId;
        private int _bUId;
        private string _bName;
        private string _bStreet;
        private string _bCity;
        private string _bCountry;
        private string _bPhone;
        private string _bWeb;
        private string _bEmail;
        private string _bType;
        private DateTime _bCreatedAt;
        private DateTime _bUpdatedAt;
        private string _bImageFolderId;
        private int _bRater;
        private float _bRating;

        public int BId { get { return _bId; } set { _bId = value; } }
        public int BUId { get { return _bUId; } set { _bUId = value; } }
        public string BName { get { return _bName; } set { _bName = value; } }
        public string BStreet { get { return _bStreet; } set { _bStreet = value; } }
        public string BCity { get { return _bCity; } set { _bCity = value; } }
        public string BCountry { get { return _bCountry; } set { _bCountry = value; } }
        public string BPhone { get { return _bPhone; } set { _bPhone = value; } }
        public string BWeb { get { return _bWeb; } set { _bWeb = value; } }
        public string BEmail { get { return _bEmail; } set { _bEmail = value; } }
        public string BType { get { return _bType; } set { _bType = value; } }
        public DateTime BCreatedAt { get { return _bCreatedAt; } set { _bCreatedAt = value; } }
        public DateTime BUpdatedAt { get { return _bUpdatedAt; } set { _bUpdatedAt = value; } }
        public string BImageFolderID { get { return _bImageFolderId; } set { _bImageFolderId = value; } }
        public int BRater { get { return _bRater; } set { _bRater = value; } }
        public float BRating { get { return _bRating; } set { _bRating = value; } }

        public BusinessItem() { }

        public BusinessItem(DataRow row)
        {
            if (row["BId"] != DBNull.Value) { BId = int.Parse(row["BId"].ToString()); }
            if (row["BUId"] != DBNull.Value) { BUId = int.Parse(row["BUId"].ToString()); }
            if (row["BName"] != DBNull.Value) { BName = row["BName"].ToString(); }
            if (row["BStreet"] != DBNull.Value) { BStreet = row["BStreet"].ToString(); }
            if (row["BCity"] != DBNull.Value) { BCity = row["BCity"].ToString(); }
            if (row["BCountry"] != DBNull.Value) { BCountry = row["BCountry"].ToString(); }
            if (row["BPhone"] != DBNull.Value) { BPhone = row["BPhone"].ToString(); }
            if (row["BWeb"] != DBNull.Value) { BWeb = row["BWeb"].ToString(); }
            if (row["BEmail"] != DBNull.Value) { BEmail = row["BEmail"].ToString(); }
            if (row["BType"] != DBNull.Value) { BType = row["BType"].ToString(); }
            if (row["BCreatedAt"] != DBNull.Value) { BCreatedAt = DateTime.Parse(row["BCreatedAt"].ToString()); }
            if (row["BUpdatedAt"] != DBNull.Value) { BUpdatedAt = DateTime.Parse(row["BUpdatedAt"].ToString()); }
            if (row["BImageFolderID"] != DBNull.Value) { BImageFolderID = row["BImageFolderID"].ToString(); }
            if (row["BRater"] != DBNull.Value) { BRater = int.Parse(row["BRater"].ToString()); }
            if (row["BRating"] != DBNull.Value) { BRating = float.Parse(row["BRating"].ToString()); }

        }
    }
}
